Dynomotion

Group: DynoMotion Message: 10636 From: rjreese29@ymail.com Date: 12/4/2014
Subject: Mach3 led and kflop not synced
Hi,
I have a button in mach3 that is userdefined153. It executes code attached to this button and works as expected. The vb code is as follows:

NotifyPlugins(10303)
Sleep300
DoOEMButton(251) 'dis/enables y axis

Pushing this button with every single click turns off and on my bit in kflop.
My issue lies with the fact that mach3 oemled is not synced with it. Every other cycle of enable and disable press does it only sync.

In short,
The kflop does as expected and turns on/off the kflop bit 26 through the mach screen button and it works every time.
Mach3 axis inhibit y led (87) will not sync with this action, but the led in mach is doing what it says it is doing with in mach itself. It does sync up every 2 cycles though with the kflop.

My thread 4 in kmotion433f is running the mach3 notifyplugins and the code is as follows:

if (msg==10303)
{
if (Readbit(26)==1)
Clearbit(26);
else
Setbit(36);
}
It's pretty obvious this is more of a mach3 issue, but was wondering if anyone has seen this before.

Would anyone know how to sync these 2 to ensure what kflop and Mach3 are doing?
I have been attempting to fix this in the vbscript through, checking the oemled state (if getoemled(87,1) then ...) but I couldn't get this to work.

Any suggestions would be appreciated.

Thanks
Rob
Group: DynoMotion Message: 10638 From: Tom Kerekes Date: 12/4/2014
Subject: Re: Mach3 led and kflop not synced
Hi Rob,

I'm not sure I understand but it seems to work perfectly for me.

I do see 5 typo errors in your C code (26 vs 36 and bit vs Bit)
and 1 typo in your Basic code (Sleep needs a space between Sleep and 300)

I used Mach3 Version R3.043.066 and latest Test Version of KMotion.

I changed the C code to use a KFLOP LED (bit46)

I put the Basic code into the Mache Help Button "GCodes"

The KFLOP LED and the Mach3 Inhibit Y LED toggle each button press and always shows the same state.

Regards
TK

Group: DynoMotion Message: 10640 From: Rjreese29 Date: 12/4/2014
Subject: Re: Mach3 led and kflop not synced
Hi Tom,

Yes. Y code below in my email is incorrect.26 & bit 36 is a typo. my code on my machine is bit 26 for both.

It is really strange behavior. It happens on all buttons I have created for x or y or z inhibit buttons. 

I have to press each button 4x for the (led and axis enable) to sync with the kflop. The kflop does what it should, so I am going to move this to the mach forum.

It seems that when these 2 items are synced (with axis disabled/low in both kflop and mach), with the next button push, mach3 (led) does not turn on with the next toggle.

Hope that helps to make it more clear.

Thanks,


Rob

On Dec 4, 2014, at 8:39 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Rob,

I'm not sure I understand but it seems to work perfectly for me.

I do see 5 typo errors in your C code (26 vs 36 and bit vs Bit)
and 1 typo in your Basic code (Sleep needs a space between Sleep and 300)

I used Mach3 Version R3.043.066 and latest Test Version of KMotion.

I changed the C code to use a KFLOP LED (bit46)

I put the Basic code into the Mache Help Button "GCodes"

The KFLOP LED and the Mach3 Inhibit Y LED toggle each button press and always shows the same state.

Regards
TK

Group: DynoMotion Message: 10645 From: Tom Kerekes Date: 12/5/2014
Subject: Re: Mach3 led and kflop not synced
Hi Rob,

It seemed to work perfectly for me. 

Do you have IO26 configured as anything in Mach3?  You might try to change temporarily to IO46 (KFLOP LED) to eliminate that possibility.

You might try using the same Mach3 Version I did and adding your code to the GCode button like I did to see if it then works perfectly for you.

Did you also fix the typo in the Sleep line?

Regards
TK

Group: DynoMotion Message: 10648 From: Rjreese29 Date: 12/5/2014
Subject: Re: Mach3 led and kflop not synced
Hi Tom,
Thanks for your suggestions. I will give these items a try this weekend.


Yes on the typo.The typo was in my email, not in my code.

Thank you!!

Rob

On Dec 5, 2014, at 10:32 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi Rob,

It seemed to work perfectly for me. 

Do you have IO26 configured as anything in Mach3?  You might try to change temporarily to IO46 (KFLOP LED) to eliminate that possibility.

You might try using the same Mach3 Version I did and adding your code to the GCode button like I did to see if it then works perfectly for you.

Did you also fix the typo in the Sleep line?

Regards
TK